package tests;

import junit.framework.Assert;
import hexgame.HexMove;
import network.HexNetwork;

public class HexNetworkTests {
	// only match constants equal to null, true and false
	//@Test(expected = JSONParseException.class)
	public void testParseMove_basic()
	{
		HexMove move = HexNetwork.parseMove("(5, 4)");
		
		Assert.assertEquals(5, move.getX());
		Assert.assertEquals(4, move.getY());
	}
	
	public void testParseMove_basic2()
	{
		HexMove move = HexNetwork.parseMove("(10, 15)");
		
		Assert.assertEquals(10, move.getX());
		Assert.assertEquals(15, move.getY());
	}
	
	public void testParseMove_brackets()
	{
		HexMove move = HexNetwork.parseMove("5, 4)");
		
		Assert.assertEquals(null, move);
	}
	
	public void testParseMove_brackets2()
	{
		HexMove move = HexNetwork.parseMove("5, 4");
		
		Assert.assertEquals(null, move);
	}
	
	public void testParseMove_brackets3()
	{
		HexMove move = HexNetwork.parseMove("(5, 4");
		
		Assert.assertEquals(null, move);
	}
	
	public void testParseMove_commaSplit()
	{
		HexMove move = HexNetwork.parseMove("(5,)");
		
		Assert.assertEquals(null, move);
	}
	public void testParseMove_commaSplit2()
	{
		HexMove move = HexNetwork.parseMove("(,)");
		
		Assert.assertEquals(null, move);
	}
	public void testParseMove_commaSplit3()
	{
		HexMove move = HexNetwork.parseMove("()");
		
		Assert.assertEquals(null, move);
	}
	public void testParseMove_commaSplit4()
	{
		HexMove move = HexNetwork.parseMove("(, 4)");
		
		Assert.assertEquals(null, move);
	}
}
